package com.hns.can.service.service;

import com.hns.can.common.aop.orgTree.LeftOrgAnnotation;
import com.hns.can.common.constants.GlobalConst;
import com.hns.can.common.formula.FillCodeDscValue;
import com.hns.can.common.formula.FillParamsVo;
import com.hns.can.common.service.BaseInfoValueService;
import com.hns.can.service.entity.BaseElectFencEntity;
import com.hns.can.service.entity.CommElectFencAlmEntity;

import com.hns.can.service.vo.ElectFencAlmParamsVo;
import com.hns.can.service.vo.ElectFencAlmReportVo;
import com.hns.can.service.vo.ElectFencExVo;
import com.hns.can.service.vo.LineOffsetDetailVo;
import com.hns.frame.mybatis.Pagination;
import com.hns.frame.service.CommonService;
import com.hns.tool.pub.PubUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 电子围栏报警Service
 * @author:zhangzq
 * @email:
 * @version Revision 2.0.0
 */
@Service
public class ElectFencAlmService extends CommonService {

    @Autowired
    private BaseInfoValueService baseInfoValueService;

    /**
     * 分页查询电子围栏报警
     * @param vo
     * @author:zhangzq
     * @email:
     */
    @LeftOrgAnnotation()
    @Transactional
    public Pagination searchElectFencAlmPage(ElectFencAlmParamsVo vo) throws Exception {
        Pagination page = this.myBatisPage("electFencAlm.searchElectFencAlmCount", "electFencAlm.searchElectFencAlmList", vo, LineOffsetDetailVo.class);
        List list = page.getData();
        baseInfoValueService.fillOrganLineLicPltNo(list);
        page.setData(list);
        return page;
    }

    /**
     * 查询电子围栏报警统计信息
     * @param vo
     * @author:zhangzq
     * @email:
     */
    @LeftOrgAnnotation()
    @Transactional
    public List<ElectFencAlmReportVo> searchElectFencStatis(ElectFencAlmParamsVo vo) throws Exception {
        List<ElectFencAlmReportVo> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("electFencAlm.searchElectFencStatis", vo), ElectFencAlmReportVo.class);
        return list;
    }

    /**
     * 查询异常区报警信息
     * @param vo
     * @author:zhangzq
     * @email:
     */
    @LeftOrgAnnotation()
    @Transactional
    public Pagination searchElectFencExDetail(ElectFencAlmParamsVo vo) throws Exception {
        Pagination page = this.myBatisPage("electFencAlm.searchElectFencExAlmCount", "electFencAlm.searchElectFencExAlmList", vo, ElectFencExVo.class);
        List list = page.getData();
        baseInfoValueService.fillOrganLineLicPltNo(list);
        page.setData(list);
        return page;
    }

}
